package zyn.kotlin.integral.car

import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestParam
import org.springframework.web.bind.annotation.RestController
import zyn.kotlin.integral.entity.User

/**
 * @description
 *
 * @author zhangyanan
 * @date 2017/11/12 0012 21:32
 */
@RestController
class CarRouter {
    @Autowired
    lateinit var carsService: CarsService

    @GetMapping("/cars")
    fun getCars(@RequestParam("name", required = false) name: String?): List<User>? {
        println("receive params :" + name)
        return carsService.getCars()
    }
}